﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Jemgine.Engine.Scripts
{
    [Jemgine.Engine.Node, Jemgine.Engine.Category("System")]
    public class Import : Jemgine.Data.ScriptNode
    {
        public string MapName { get; set; }

        public Import()
        {
            AddInput("Fire", null);
            AddOutput("Relay", null);
        }

        public override void FireTerminal(int InputID, Jemgine.Data.ScriptPayload Payload)
        {
            if (InputID == 0)
            {
                Data.MapData Data = null;
                Sim.ImportMap(out Data, MapName, Position, false, Sim.DefaultElementHandler);
            }

            OutputTerminals[0].Fire(Payload);
        }
    }
}
